//
//  AXHomeZjzdZdzFirstCell.m
//  AnXin100
//
//  Created by 天质弘耕 on 2018/11/6.
//  Copyright © 2018 tzhg. All rights reserved.
//

#import "AXHomeZjzdZdzFirstCell.h"
#import "ZXCategories.h"
#import "UIView+SDAutoLayout.h"

@implementation AXHomeZjzdZdzFirstCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
      
        [self creatView];
        [self setlayout];
    }
    return self;
}

- (void)creatView {
    
    self.bgView = [[UIView alloc]init];
    self.bgView.cornerRadius = 5;
    self.bgView.backgroundColor = [UIColor groupTableViewBackgroundColor];
    [self.contentView addSubview:self.bgView];
    
    self.xsLabel = [[UILabel alloc]init];
    self.xsLabel.text = @"悬赏";
    self.xsLabel.font = FONT_FOURTEEN;
    self.xsLabel.textColor = COLOR_ORG;
    [self.bgView addSubview:self.xsLabel];
    
    self.questionLabel = [[UILabel alloc]init];
    self.questionLabel.textColor = COLOR_DIV;
    self.questionLabel.text = @"葡萄种植技术";
    self.questionLabel.font = FONT_FOURTEEN;
    [self.bgView addSubview:self.questionLabel];
    
    self.priceLabel = [[UILabel alloc]init];
    self.priceLabel.textColor = COLOR_ORG;
    self.priceLabel.text = @"￥44.00";
    self.priceLabel.font = FONT_FOURTEEN;
    [self.bgView addSubview:self.priceLabel];
    
    
    self.timeLabel = [[UILabel alloc]init];
    self.timeLabel.textColor = COLOR_DIV;
    self.timeLabel.text = @"咨询时间：2018-10-08";
    self.timeLabel.font = FONT_FOURTEEN;
    [self.bgView addSubview:self.timeLabel];
    
    
    self.ordersBtn = [[UIButton alloc]init];
    self.ordersBtn.cornerRadius = 5;
    self.ordersBtn.titleLabel.font = FONT_FOURTEEN;
    self.ordersBtn.backgroundColor = COLOR_ORG;
    [self.ordersBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [self.ordersBtn setTitle:@"待接单" forState:UIControlStateNormal];
    [self.bgView addSubview:self.ordersBtn];
    
    
    
}

- (void)setlayout {
    
    self.bgView.sd_layout
    .leftSpaceToView(self.contentView, 10)
    .topSpaceToView(self.contentView, 10)
    .widthIs(SCREEN_WIDTH-20)
    .heightIs(90);
    
    self.xsLabel.sd_layout
    .leftSpaceToView(self.bgView, 10)
    .topSpaceToView(self.bgView, 10)
    .widthIs(40)
    .heightIs(30);
    
    self.questionLabel.sd_layout
    .leftSpaceToView(self.xsLabel, 10)
    .topEqualToView(self.xsLabel)
    .widthIs(100)
    .heightRatioToView(self.xsLabel, 1);
    
    self.timeLabel.sd_layout
    .leftEqualToView(self.questionLabel)
    .topSpaceToView(self.questionLabel, 10)
    .widthIs(150)
    .heightRatioToView(self.xsLabel, 1);
    
    self.ordersBtn.sd_layout
    .rightSpaceToView(self.bgView, 10)
    .topSpaceToView(self.bgView, 10)
    .widthIs(80)
    .heightRatioToView(self.xsLabel, 1);
    
    self.priceLabel.sd_layout
    .rightSpaceToView(self.ordersBtn, 10)
    .topEqualToView(self.questionLabel)
    .widthIs(80)
    .heightRatioToView(self.xsLabel, 1);
    
    
    
}


@end
